Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loopd: nil-pointer bug when showing subsystems #560

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

ziggie1984
Copy link
Contributor

@ziggie1984 ziggie1984 commented Mar 24, 2023

Just a short drive-bug fix: loopd crashes when you wanna show the logging subsystems with loopd --debuglevel show

This fix just copies the rogue code to another place, but I think a better fix would be to get rid of the global pointer and maybe just return the logger when setting it up ?

Pull Request Checklist

  • Update release_notes.md if your PR contains major features, breaking changes or bugfixes

@@ -204,6 +197,13 @@ func Run(rpcCfg RPCConfig) error {
logWriter := build.NewRotatingLogWriter()
SetupLoggers(logWriter, shutdownInterceptor)

// Special show command to list supported subsystems and exit.
if config.DebugLevel == "show" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fix effective because if err := Validate(&config) precedes now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm let me check

Copy link
Contributor Author

@ziggie1984 ziggie1984 Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah so debuglevel validation seems not part and not necessary to validate so it should be fixed, but maybe we clean this code part up a bit, maybe just get rid of the global pointer variable which led to the bug in the first place and do a clean initialization ?

@hieblmi hieblmi marked this pull request as ready for review November 18, 2024 13:51
Copy link
Collaborator

@hieblmi hieblmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased this PR and tested, as @ziggie1984 mentioned the validation doesn't check the debuglevel, so moving the code is fine. LGTM 💾

✅ tAck

Copy link
Member

@bhandras bhandras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@hieblmi hieblmi merged commit 7f13441 into lightninglabs:master Nov 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants